package cn.tedu;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

public class Demo03 {
    public static void main(String[] args) {
        try (Connection conn = DBUtils.getConn()){

            Statement s = conn.createStatement();
            ResultSet rs=s.executeQuery("select *from hero");
            while (rs.next()){
                int id = rs.getInt("id");
                String name = rs.getString("name");
                double money = rs.getDouble("money");
                System.out.println(id+":"+name+":"+money);
            }

            System.out.println("执行完毕!");
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
    }
}
